<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .wrap{
            width: 300px;
            height: 300px;
            background: gray;
        }
        .inner{
            width: 200px;
            height: 200px;
            background: pink;
        }
        .test{
            width: 100px;
            height: 100px;
            background: black;
        }
    </style>
</head>
<body>
    <div id="app">

        <button @click.once="num += 1">+</button> {{num}}

        <div class="wrap" @click.self="wrapFn">
            <div class="inner" @click="innerFn">
                <div class="test" @click.self="testFn">

                </div>
            </div>
        </div>

        <a href="http://www.atguigu.com" @click.prevent="">尚硅谷</a>

        <input type="text" @keydown.space="keydownFn">

        <button @click.right.prevent="fn">click me</button>
        <button @click.middle="fn">click me</button>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    Vue.config.productionTip = false

    new Vue({
        el:"#app",
        data:{
          num:0
        },
        methods:{
            wrapFn(){
                console.log("wrapFn")
            },
            innerFn(){
                console.log("innerFn")
            },
            testFn(){
                console.log("testFn")
            },
            keydownFn(){
                console.log("keydownFn")
            },
            fn(){
                console.log("fn")
            }
        }
    })
</script>
</html>